<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'message.label', default: 'Message')}"/>
    <title>交易流水</title>
</head>

<body class="fixed-navbar fixed-sidebar">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>云丛管理系统</li>
                    <li class="active">
                        <span>科目明细</span>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>

<div class="content animate-panel">

    <g:if test="${flash.message}">
        <div class="alert alert-success alert-dismissible" message="alert">
            ${flash.message}
        </div>
    </g:if>
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    %{-- <g:link action="create" class="btn btn-info btn-xs"><i class="fa fa-edit"></i>新建</g:link> --}%
                </div>
            贷方
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '交易类型')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '实收（元）')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '应收（元）')}"/>
                            %{--<g:sortableColumn property="authority"--}%
                                              %{--title="${message(code: 'message.authority.label', default: '借方账户名')}"/>--}%
                            %{--<g:sortableColumn property="authority"--}%
                                              %{--title="${message(code: 'message.authority.label', default: '借方卡号')}"/>--}%
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '贷方账户名')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '贷方科目')}"/>
                            <g:sortableColumn property="authority"
                                                title="${message(code: 'message.authority.label', default: '贷方卡号')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '预计开始时间')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '交易完成时间')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '清分账号')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '交易状态')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '交易失败原因')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '创建时间')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '修改时间')}"/>


                        </tr>
                        </thead>
                        <tbody>
                        <g:if test="${list.size()>0}">
                                <tr>
                                    <td>${list[0].type?.name}</td>
                                    <g:if test="${list[0].status?.name=='未执行'}">
                                        <td>0</td>
                                    </g:if>
                                    <g:else>
                                        <td><g:formatNumber number="${list[0].opportunity?.actualLoanAmount}" minFractionDigits="0" maxFractionDigits="2"/></td>
                                    </g:else>
                                    <td><g:formatNumber number="${list[0].opportunity?.actualLoanAmount}" minFractionDigits="0" maxFractionDigits="2"/></td>
                                    %{--<td>${it.debit?.name}</td>--}%
                                    %{--<td>${it.debit?.numberOfAccount}</td>--}%
                                    <td><span class="nameFormat">${list[0].credit?.name}</span></td>
                                    <td>${list[0].credit?.subject}</td>
                                    <td>${list[0].credit?.numberOfAccount}</td>
                                    <td>${list[0].plannedStartTime}</td>
                                    <td>${list[0].endTime}</td>
                                    <td>${list[0].debitAccount}</td>
                                    <td>${list[0].status?.name}</td>
                                    <td>${list[0].memo}</td>
                                    <td>${list[0].createdDate}</td>
                                    <td>${list[0].modifiedDate}</td>

                                </tr>
                        </g:if>

                        </tbody>
                    </table>
                </div>
            </div>

        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    %{-- <g:link action="create" class="btn btn-info btn-xs"><i class="fa fa-edit"></i>新建</g:link> --}%
                </div>
                借方
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '交易类型')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '实收（元）')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '应收（元）')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '借方账户名')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '借方科目')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '借方卡号')}"/>
                            %{--<g:sortableColumn property="authority"--}%
                                              %{--title="${message(code: 'message.authority.label', default: '贷方账户名')}"/>--}%
                            %{--<g:sortableColumn property="authority"--}%
                                              %{--title="${message(code: 'message.authority.label', default: '贷方卡号')}"/>--}%
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '预计开始时间')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '交易完成时间')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '清分账号')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '交易状态')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '交易失败原因')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '创建时间')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '修改时间')}"/>
                            <g:sortableColumn property="authority"
                                              title="${message(code: 'message.authority.label', default: '付款方式')}"/>

                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${list}">
                            <tr>

                                <td>${it.type?.name}</td>
                                <g:if test="${it.status?.name=='未执行'}">
                                    <td>0</td>
                                </g:if>
                                <g:else>
                                    <td><g:formatNumber number="${it.amount}" minFractionDigits="0" maxFractionDigits="2"/></td>
                                </g:else>
                                <td><g:formatNumber number="${it.amount}" minFractionDigits="0" maxFractionDigits="2"/></td>
                                <td>${it.debit?.name}</td>
                                <td>${it.debit?.subject}</td>
                                <td>${it.debit?.numberOfAccount}</td>
                                %{--<td><span class="nameFormat">${it.credit?.name}</span></td>--}%
                                %{--<td>${it.credit?.numberOfAccount}</td>--}%
                                <td>${it.plannedStartTime}</td>
                                <td>${it.endTime}</td>
                                <td>${it.debitAccount}</td>
                                <td>${it.status?.name}</td>
                                <td>${it.memo}</td>
                                <td>${it.createdDate}</td>
                                <td>${it.modifiedDate}</td>
                                <td>${it.repaymentMethod.name}</td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>

        </div>
    </div>

</div>
<g:javascript>
</g:javascript>
</body>
</html>
